using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class PluginKeyList : GeneratedMessageLite<PluginKeyList, PluginKeyList.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<PluginKeyList, PluginKeyList.Builder>
		{
			private bool resultIsReadOnly;
			private PluginKeyList result;
			protected override PluginKeyList.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override PluginKeyList MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override PluginKeyList DefaultInstanceForType
			{
				get
				{
					return PluginKeyList.DefaultInstance;
				}
			}
			public uint Count
			{
				get
				{
					return this.result.Count;
				}
				set
				{
					this.SetCount(value);
				}
			}
			public IPopsicleList<PluginKey> ListList
			{
				get
				{
					return this.PrepareBuilder().list_;
				}
			}
			public int ListCount
			{
				get
				{
					return this.result.ListCount;
				}
			}
			public Builder()
			{
				this.result = PluginKeyList.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(PluginKeyList cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private PluginKeyList PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					PluginKeyList other = this.result;
					this.result = new PluginKeyList();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override PluginKeyList.Builder Clear()
			{
				this.result = PluginKeyList.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override PluginKeyList.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new PluginKeyList.Builder(this.result);
				}
				return new PluginKeyList.Builder().MergeFrom(this.result);
			}
			public override PluginKeyList BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override PluginKeyList.Builder MergeFrom(IMessageLite other)
			{
				if (other is PluginKeyList)
				{
					return this.MergeFrom((PluginKeyList)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override PluginKeyList.Builder MergeFrom(PluginKeyList other)
			{
				return this;
			}
			public override PluginKeyList.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override PluginKeyList.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(PluginKeyList._pluginKeyListFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = PluginKeyList._pluginKeyListFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 8u)
					{
						if (num3 != 18u)
						{
							if (WireFormat.IsEndGroupTag(num))
							{
								return this;
							}
							this.ParseUnknownField(input, extensionRegistry, num, text);
						}
						else
						{
							input.ReadMessageArray<PluginKey>(num, text, this.result.list_, PluginKey.DefaultInstance, extensionRegistry);
						}
					}
					else
					{
						this.result.hasCount = input.ReadUInt32(ref this.result.count_);
					}
				}
				return this;
			}
			public PluginKeyList.Builder SetCount(uint value)
			{
				this.PrepareBuilder();
				this.result.hasCount = true;
				this.result.count_ = value;
				return this;
			}
			public PluginKeyList.Builder ClearCount()
			{
				this.PrepareBuilder();
				this.result.hasCount = false;
				this.result.count_ = 0u;
				return this;
			}
			public PluginKey GetList(int index)
			{
				return this.result.GetList(index);
			}
			public PluginKeyList.Builder SetList(int index, PluginKey value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_[index] = value;
				return this;
			}
			public PluginKeyList.Builder SetList(int index, PluginKey.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_[index] = builderForValue.Build();
				return this;
			}
			public PluginKeyList.Builder AddList(PluginKey value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_.Add(value);
				return this;
			}
			public PluginKeyList.Builder AddList(PluginKey.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_.Add(builderForValue.Build());
				return this;
			}
			public PluginKeyList.Builder AddRangeList(IEnumerable<PluginKey> values)
			{
				this.PrepareBuilder();
				this.result.list_.Add(values);
				return this;
			}
			public PluginKeyList.Builder ClearList()
			{
				this.PrepareBuilder();
				this.result.list_.Clear();
				return this;
			}
		}
		public const int CountFieldNumber = 1;
		public const int ListFieldNumber = 2;
		private static readonly PluginKeyList defaultInstance;
		private static readonly string[] _pluginKeyListFieldNames;
		private static readonly uint[] _pluginKeyListFieldTags;
		private bool hasCount;
		private uint count_;
		private PopsicleList<PluginKey> list_ = new PopsicleList<PluginKey>();
		private int memoizedSerializedSize = -1;
		public static PluginKeyList DefaultInstance
		{
			get
			{
				return PluginKeyList.defaultInstance;
			}
		}
		public override PluginKeyList DefaultInstanceForType
		{
			get
			{
				return PluginKeyList.DefaultInstance;
			}
		}
		protected override PluginKeyList ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint Count
		{
			get
			{
				return this.count_;
			}
		}
		public IList<PluginKey> ListList
		{
			get
			{
				return this.list_;
			}
		}
		public int ListCount
		{
			get
			{
				return this.list_.Count;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasCount;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasCount)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.Count);
				}
				using (IEnumerator<PluginKey> enumerator = this.ListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						PluginKey current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(2, current);
					}
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private PluginKeyList()
		{
		}
		public PluginKey GetList(int index)
		{
			return this.list_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] pluginKeyListFieldNames = PluginKeyList._pluginKeyListFieldNames;
			if (this.hasCount)
			{
				output.WriteUInt32(1, pluginKeyListFieldNames[0], this.Count);
			}
			if (this.list_.Count > 0)
			{
				output.WriteMessageArray<PluginKey>(2, pluginKeyListFieldNames[1], this.list_);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasCount)
			{
				num ^= this.count_.GetHashCode();
			}
			using (IEnumerator<PluginKey> enumerator = this.list_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					PluginKey current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			return num;
		}
		public override bool Equals(object value)
		{
			PluginKeyList pluginKeyList = value as PluginKeyList;
			if (pluginKeyList == null)
			{
				return false;
			}
			if (this.hasCount != pluginKeyList.hasCount || (this.hasCount && !this.count_.Equals(pluginKeyList.count_)))
			{
				return false;
			}
			if (this.list_.Count != pluginKeyList.list_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.list_.Count; i++)
			{
				if (!this.list_[i].Equals(pluginKeyList.list_[i]))
				{
					return false;
				}
			}
			return true;
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<PluginKeyList, PluginKeyList.Builder>.PrintField("Count", this.hasCount, this.count_, writer);
			GeneratedMessageLite<PluginKeyList, PluginKeyList.Builder>.PrintField<PluginKey>("List", this.list_, writer);
		}
		public static PluginKeyList ParseFrom(byte[] data)
		{
			return PluginKeyList.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private PluginKeyList MakeReadOnly()
		{
			this.list_.MakeReadOnly();
			return this;
		}
		public static PluginKeyList.Builder CreateBuilder()
		{
			return new PluginKeyList.Builder();
		}
		public override PluginKeyList.Builder ToBuilder()
		{
			return PluginKeyList.CreateBuilder(this);
		}
		public override PluginKeyList.Builder CreateBuilderForType()
		{
			return new PluginKeyList.Builder();
		}
		public static PluginKeyList.Builder CreateBuilder(PluginKeyList prototype)
		{
			return new PluginKeyList.Builder(prototype);
		}
		static PluginKeyList()
		{
			PluginKeyList.defaultInstance = new PluginKeyList().MakeReadOnly();
			PluginKeyList._pluginKeyListFieldNames = new string[]
			{
				"Count",
				"List"
			};
			PluginKeyList._pluginKeyListFieldTags = new uint[]
			{
				8u,
				18u
			};
			object.ReferenceEquals(micromsg.Proto.PluginKeyList.Descriptor, null);
		}
	}
}
